<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>服务页面</title>

		<link href="./AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="./AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css" />

		<link href="./basic/css/demo.css" rel="stylesheet" type="text/css" />

		<link href="./css/seastyle.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="./basic/js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="./js/script.js"></script>

		<script src="js/plugins/vue/dist/vue.js"></script>
		<script src="js/plugins/axios/dist/axios.js"></script>
		<!--全局配置，以后只要用vue+axios的页面都引入common.js-->
		<script src="js/common.js"></script>
	</head>

	<body>
		<div id="productDiv">
		<!--顶部导航条 -->
		<div class="am-container header">
			<ul class="message-l">
				<div class="topMessage">
					<div class="menu-hd" v-if="loginInfo">
						欢迎<span style="color: red">{{loginInfo.username||loginInfo.phone||loginInfo.email}}</span>
					</div>
					<div class="menu-hd" v-else>
						<a href="#" target="_top" class="h">亲，请登录</a>
						<!--target="_blank" 另开窗口-->
						<a href="register.html" target="_blank">免费注册</a>
					</div>

				</div>
			</ul>
			<ul class="message-r">
				<div class="topMessage home">
					<div class="menu-hd"><a href="#" target="_top" class="h">商城首页</a></div>
				</div>
				<div class="topMessage my-shangcheng">
					<div class="menu-hd MyShangcheng"><a href="#" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
				</div>
				<div class="topMessage mini-cart">
					<div class="menu-hd"><a id="mc-menu-hd" href="#" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
				</div>
				<div class="topMessage favorite">
					<div class="menu-hd"><a href="#" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
			</ul>
			</div>

			<!--悬浮搜索框-->

			<div class="nav white">
				<div class="logo"><img src="./images/logo.png" /></div>
				<div class="logoBig">
					<li><img src="./images/logobig.png" /></li>
				</div>

				<div class="search-bar pr">
					<a name="index_none_header_sysc" href="#"></a>
					<form>
						<input id="searchInput" v-model="queryParams.keyword" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
						<input id="ai-topsearch" @click="search" class="submit am-btn"  value="搜索" index="1" type="button">
					</form>
				</div>
			</div>

			<div class="clear"></div>
			<b class="line"></b>
           <div class="search">
			<div class="search-list">
			<div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
						   <ul>
							   <li class="index"><a href="#" style="width: 100px">首页</a></li>
							   <li class="qc"><a href="product.html" style="width: 100px" target="_blank">服务</a></li>
							   <li class="qc"><a href="#" style="width: 100px">小宠</a></li>
							   <li class="qc"><a href="#" style="width: 100px">百科</a></li>
							   <li class="qc last" style="width: 100px"><a href="aboutUs.html" target="_blank">关于我们</a></li>
						   </ul>
						    <div class="nav-extra">
						    	<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
						    	<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
						    </div>
						</div>
			</div>
			
				
					<div class="am-g am-g-fixed">
						<div class="am-u-sm-12 am-u-md-12">
	                  	<div class="theme-popover">														
							<div class="searchAbout">
								<span class="font-pale">相关搜索：</span>
								<a title="坚果" href="#">泰迪</a>
								<a title="瓜子" href="#">哈士奇</a>
								<a title="鸡腿" href="#">。。。</a>

							</div>
							<ul class="select">
								<p class="title font-normal">
									<span class="fl">松子</span>
									<span class="total fl">搜索到<strong class="num">997</strong>件相关商品</span>
								</p>
								<div class="clear"></div>
								<li class="select-result">
									<dl>
										<dt>已选</dt>
										<dd class="select-no"></dd>
										<p class="eliminateCriteria">清除</p>
									</dl>
								</li>
								<div class="clear"></div>
								<li class="select-list">
									<dl id="select1">
										<dt class="am-badge am-round">品种</dt>
									
										 <div class="dd-conent">										
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">哈士奇</a></dd>
											<dd><a href="#">藏獒</a></dd>
											<dd><a href="#">贵宾犬</a></dd>
											<dd><a href="#">松狮</a></dd>
											<dd><a href="#">边境牧羊犬</a></dd>
											<dd><a href="#">吉娃娃</a></dd>
										 </div>
						
									</dl>
								</li>
								<li class="select-list">
									<dl id="select2">
										<dt class="am-badge am-round">种类</dt>
										<div class="dd-conent">
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">杂交</a></dd>
											<dd><a href="#">纯种</a></dd>
											<dd><a href="#">中华本土</a></dd>
											<dd><a href="#">流浪</a></dd>
										</div>
									</dl>
								</li>
								<li class="select-list">
									<dl id="select3">
										<dt class="am-badge am-round">选购热点</dt>
										<div class="dd-conent">
											<dd class="select-all selected"><a href="#">全部</a></dd>
											<dd><a href="#">一哈战五虎</a></dd>
											<dd><a href="#">三哈沉航母</a></dd>
											<dd><a href="#">五哈灭地球</a></dd>
											<dd><a href="#">十哈毁宇宙</a></dd>
										</div>
									</dl>
								</li>
					        
							</ul>
							<div class="clear"></div>
                        </div>
							<div class="search-content">
								<div class="sort">
									<li class="first"><a title="综合">综合排序</a></li>
									<li><a title="销量">销量排序</a></li>
									<li><a title="价格">价格优先</a></li>
									<li class="big"><a title="评价" href="#">评价为主</a></li>
								</div>
								<div class="clear"></div>

								<ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes">
                                    <!--由于查到的是多条数据，所以我们在这里需要便利-->
									<!--需要进到详情页的话我们还需要拿到当前数据的id-->
									<li v-for="product in pageList.rows" @click="getDetail(product.id)">
										<div class="i-pic limit">
											<!--<img src="./images/imgsearch1.jpg" />	-->
											<!--因为是动态添加事件所以我们需要给他一个事件绑定-->
											<img :src="fastDfsUrl+product.resources.split(',')[0]+suffix" alt="图片过于可爱无法展示"/>
											<p class="title fl">【官方旗舰店】{{product.name}}</p>
											<p class="price fl">
												<b>¥</b>
												<strong>{{product.saleprice}}</strong>
											</p>
											<p class="number fl">
												销量<span>{{product.salecount}}</span>
											</p>
										</div>
									</li>
								</ul>
							</div>
							<div class="search-side">

								<div class="side-title">
									经典搭配
								</div>

								<li>
									<div class="i-pic check">
										<img src="./images/cp.jpg" />
										<p class="check-title">萨拉米 1+1小鸡腿</p>
										<p class="price fl">
											<b>¥</b>
											<strong>29.90</strong>
										</p>
										<p class="number fl">
											销量<span>1110</span>
										</p>
									</div>
								</li>
								<li>
									<div class="i-pic check">
										<img src="./images/cp2.jpg" />
										<p class="check-title">ZEK 原味海苔</p>
										<p class="price fl">
											<b>¥</b>
											<strong>8.90</strong>
										</p>
										<p class="number fl">
											销量<span>1110</span>
										</p>
									</div>
								</li>
								<li>
									<div class="i-pic check">
										<img src="./images/cp.jpg" />
										<p class="check-title">萨拉米 1+1小鸡腿</p>
										<p class="price fl">
											<b>¥</b>
											<strong>29.90</strong>
										</p>
										<p class="number fl">
											销量<span>1110</span>
										</p>
									</div>
								</li>

							</div>
							<div class="clear"></div>
							<!--分页 -->
							<ul class="am-pagination am-pagination-right">
								<!--如果当前页为1，那么上一页就不生效，直接等于1，加上javascript:;是防止他的页面会发生跳动-->
								<!--每次只用将常洵页面的数据中的当前页设置为当前的页码就是完成分页了-->
								<li><a href="javascript:;" @click="handleCurrentChange(queryParams.currentPage-1)">&laquo;</a></li>
								<!--中间的这些分页我们就正常显示即可，但是需要循环遍历-->
								<li v-for="page in totalPages">
									<a href="javascript:;" @click="handleCurrentChange(page)">{{page}}</a>
								</li>
								<!--<li><a href="#">2</a></li>-->
								<!--<li><a href="#">3</a></li>-->
								<!--<li><a href="#">4</a></li>-->
								<!--<li><a href="#">5</a></li>-->
								<li><a href="javascript:;" @click="handleCurrentChange(queryParams.currentPage+1)">&raquo;</a></li>
							</ul>

						</div>
					</div>
					<div class="footer">
						<div class="footer-hd">
							<p>
								<a href="#">恒望科技</a>
								<b>|</b>
								<a href="#">商城首页</a>
								<b>|</b>
								<a href="#">支付宝</a>
								<b>|</b>
								<a href="#">物流</a>
							</p>
						</div>
						<div class="footer-bd">
							<p>
								<a href="#">关于恒望</a>
								<a href="#">合作伙伴</a>
								<a href="#">联系我们</a>
								<a href="#">网站地图</a>
								<em>© 2015-2025 Hengwang.com 版权所有. 更多模板 <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></em>
							</p>
						</div>
					</div>
				</div>

			</div>

		<!--引导 -->
		<div class="navCir">
			<li><a href="home2.html"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
			<li><a href="shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>	
			<li><a href="./person/index.html"><i class="am-icon-user"></i>我的</a></li>					
		</div>

		<!--菜单 -->
		<div class=tip>
			<div id="sidebar">
				<div id="wrap">
					<div id="prof" class="item">
						<a href="#">
							<span class="setting"></span>
						</a>
						<div class="ibar_login_box status_login">
							<div class="avatar_box">
								<p class="avatar_imgbox"><img src="./images/no-img_mid_.jpg" /></p>
								<ul class="user_info">
									<li>用户名：sl1903</li>
									<li>级&nbsp;别：普通会员</li>
								</ul>
							</div>
							<div class="login_btnbox">
								<a href="#" class="login_order">我的订单</a>
								<a href="#" class="login_favorite">我的收藏</a>
							</div>
							<i class="icon_arrow_white"></i>
						</div>

					</div>
					<div id="shopCart" class="item">
						<a href="#">
							<span class="message"></span>
						</a>
						<p>
							购物车
						</p>
						<p class="cart_num">0</p>
					</div>
					<div id="asset" class="item">
						<a href="#">
							<span class="view"></span>
						</a>
						<div class="mp_tooltip">
							我的资产
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="foot" class="item">
						<a href="#">
							<span class="zuji"></span>
						</a>
						<div class="mp_tooltip">
							我的足迹
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="brand" class="item">
						<a href="#">
							<span class="wdsc"><img src="./images/wdsc.png" /></span>
						</a>
						<div class="mp_tooltip">
							我的收藏
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="broadcast" class="item">
						<a href="#">
							<span class="chongzhi"><img src="./images/chongzhi.png" /></span>
						</a>
						<div class="mp_tooltip">
							我要充值
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div class="quick_toggle">
						<li class="qtitem">
							<a href="#"><span class="kfzx"></span></a>
							<div class="mp_tooltip">客服中心<i class="icon_arrow_right_black"></i></div>
						</li>
						<!--二维码 -->
						<li class="qtitem">
							<a href="#none"><span class="mpbtn_qrcode"></span></a>
							<div class="mp_qrcode" style="display:none;"><img src="./images/weixin_code_145.png" /><i class="icon_arrow_white"></i></div>
						</li>
						<li class="qtitem">
							<a href="#top" class="return_top"><span class="top"></span></a>
						</li>
					</div>

					<!--回到顶部 -->
					<div id="quick_links_pop" class="quick_links_pop hide"></div>

				</div>

			</div>
			<div id="prof-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					我
				</div>
			</div>
			<div id="shopCart-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					购物车
				</div>
			</div>
			<div id="asset-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					资产
				</div>

				<div class="ia-head-list">
					<a href="#" target="_blank" class="pl">
						<div class="num">0</div>
						<div class="text">优惠券</div>
					</a>
					<a href="#" target="_blank" class="pl">
						<div class="num">0</div>
						<div class="text">红包</div>
					</a>
					<a href="#" target="_blank" class="pl money">
						<div class="num">￥0</div>
						<div class="text">余额</div>
					</a>
				</div>

			</div>
			<div id="foot-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					足迹
				</div>
			</div>
			<div id="brand-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					收藏
				</div>
			</div>
			<div id="broadcast-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					充值
				</div>
			</div>
		</div>
		<script>
			window.jQuery || document.write('<script src="basic/js/jquery-1.9.min.js"><\/script>');
		</script>
		<script type="text/javascript" src="./basic/js/quick_links.js"></script>

<div class="theme-popover-mask"></div>
			<script type="text/javascript">
                new Vue({
                    el:"#productDiv",
                    data:{
                        fastDfsUrl:"http://115.159.217.249:8888/",
                        suffix:"_430x430.jpg",
                        loginInfo:null,
						// 我们在后台已经根据条件查到了数据，我们在这定义前面需要用的时候才能识别的到
                        //他是个对象就拿xxx：{}。这样的形式来
                        //查询分页信息会返回两个数据，一个rows（全部数据返回一个对象）和total(多少条)
                        pageList:{
                            totals:0,
                            rows:[]
                        },
                        queryParams:{
                        //    这里写分页需要的参数
                            keyword:'',
                            currentPage:1,
                            pageSize:9
                        },//除此之外我们还需要对查询过来的一窜数据进行处理才能分页展示，就是找到总共能分多少页
                    },
                    methods:{
                        getDetail(productId){
                            //这样会覆盖原窗口
                            //location.href="productDetail.html?productId="+productId;
                            let url = "productDetail.html?productId="+productId;
                            //新窗口打开
                            window.open(url);
                        },
                        getProducts(){
                            this.$http.post("/product/list",this.queryParams)
                                .then(result=>{
                                    result = result.data; //PageList-total,rows
                                    if(result){
                                        this.pageList = result;
                                    }

                                })
                                .catch(result=>{
                                    console.log(result);
                                    alert("系统错误！")
                                })

                        },
						// 这里用来做高级查询
                        search(){
                            //重置为第一页
                            this.queryParams.currentPage = 1;
                            this.getProducts()
                        },
                        handleCurrentChange(page){
                            if(page==0){
                                this.queryParams.currentPage=1
                            } else if(page>=this.totalPages){
                                this.queryParams.currentPage=this.totalPages
                            }else{
                                this.queryParams.currentPage=page;
                            }
                            this.getProducts();
                        },
                    },
                    computed:{
                        totalPages() {
                            //Math.ceil 向上取整
                            return Math.ceil(this.pageList.totals/this.queryParams.pageSize)
                        }
                    },
                    mounted(){
                        let loginInfo=localStorage.getItem("loginInfo");
                        if(loginInfo){
                            //loginInfo是个对象，需要先转换成json字符串前台才能解析
                            this.loginInfo = JSON.parse(loginInfo);
                        }
                        this.getProducts();
                    }
                })
			</script>
		</div>
	</body>

</html>